#include "widget.h"

#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QString style;
    style += "QPushButton {color:blue;}";
    style += "QPushButton:hover {color:red;}";

    //鼠标移开时，他的优先级比类形选择器高
    style += "QPushButton:!hover {color:black;}";
    style += "QPushButton:pressed {color:green;}";

    a.setStyleSheet(style);

    Widget w;
    w.show();
    return a.exec();
}
